package cn.bdqn.service.impl;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.bdqn.dao.backend.BackendDao;
import cn.bdqn.entity.BackendUser;
import cn.bdqn.service.backendUserService;
@Service
@Transactional
public class backendUserServiceImpl implements backendUserService {
//backendDao
	@Autowired
	private BackendDao backendDao;
	
	@Override
	public BackendUser login(String username, String password) throws Exception {
		BackendUser backendUser=backendDao.checkDevUserByUserName(username,password);
		if(backendUser==null){
			//没有此用户。
			return null;
		}else{
			//用户名存在
			if(backendUser.getUserpassword().equals(password)){
				//登陆成功
				return backendUser;
			}else{
				//密码错误
				return null;
			}
		}
	}

}
